

app.models.CheckList = Ext.regModel('app.models.CheckList', {
	fields: [
		{name: 'id', type: 'string'},
		{name: 'listName', type: 'string'},
		{name: 'listType', type: 'string', defaultValue: 's'},
		{name: 'createDate', type: 'date'},
		{name: 'status', type: 'string'},
		{name: 'total', type: 'int', defaultValue: 0},
		{name: 'checked', type: 'int', defaultValue: 0}
	],
	
	associations: [
		{type: 'hasMany', model: 'ListItem', name: 'items'}
	],
	
	proxy: {type: 'app.db.CheckListDB'}
	
	
});



Ext.regModel('app.models.ListItem', {
		fields: [
				{name: 'itemOrder', type: 'int'},
				{name: 'listId', type: 'string'},
				{name: 'item', type: 'string'},
				{name: 'status', type: 'string'}
			 ],
		belongsTo: 'app.models.CheckList'
});

app.stores.checkLists = new Ext.data.Store({
	model: 'app.models.CheckList',
	sorters: 'createDate'
});